The present invention relates to a tape writing method and, more specifically, to a writing method and tape recording device (tape drive) for situations in which there is a request to write small transactions to tape.
Typical examples of tape drives include Linear Tape-Open (LTO) tape drives and the IBM Enterprise Tape Drive TS1130. There are two general classes of tape media used in these tape drives: data cartridges and write once read many (WORM) cartridges. The following explanation makes reference to CD recording media. The two cartridges correspond to CD-RW (compact disc-rewritable) and CD-R (compact disc recordable). Data stored in the former can be erased and rewritten. This cannot be done in the case of the latter.
A host sends a variable-length transaction (either a file or data) to a tape drive to be recorded (Write command). The data is sent from the host as variable-length data. When the data is written to the tape medium, the tape drive reconstructs the data as 1.6 MB fixed-length data called a DataSet (DS).
The tape drive writes the data to the tape medium in data set units. The data sets are identified using two IDs: a data set number (DS#) and a WritePass (WP). The DS# begins at 0. The DS# is used in the sense that, once data set DS#N has been filled with data, it is packed into data set DS#N+1. The WP indicates the generation/freshness of the DS#. The data sets are usually written to the data media in sequential order with respect to DS#.
For example, when the content of DS#N is updated, the DS#N is written using a WP higher than the WP of any data set on the tape. When a data set is read and the WP of DS#N is #M, the tape drive then reads DS#N+1 with a WP of M and over. In other words, when DS#N is updated, logically speaking a DS after DS#N+1, which has already been written, has been erased, and the older DS can no longer be read.
In an IBM Enterprise Tape Dive or a Linear Tape-Open (LTO) compatible tape drive, data is written to the tape medium sequentially in fixed-length data set (DS) units. The tape drive sequentially reads DS written to the tape in response to a read command from a host. A single tape cartridge can be used over and over by a tape drive by overwriting old DS with new DS.
FIG. 1 is a diagram showing a plurality of DS written on a tape medium. The DS on the tape are overwritten. The tape drive at first writes new data in DS units on the tape medium in sequential order with respect to the DS number (DS#). When DS on the tape is overwritten, it is desirable to substantially overwrite the old DS on the tape medium with a new DS using the same, unaltered DS#.
In the lower section of FIG. 1, DS#1 through #5 have been overwritten. Each DS written to the tape is assigned a DS# and a WritePass (WP) as identifiers. During data writing, the tape drive increases the DS# by one increment each time a DS is written to the tape. The WP of the same DS# indicates the number of times a writing operation has been performed. An increment is added each time an overwriting operation is performed and each time a retry operation is performed when an error occurs. When a DS writing operation fails at DS#X (where X is an arbitrary number), the tape drive allows the increased value for the WP as a DS of a subsequent number.
The upper section of FIG. 1 indicates the current data writing state. This is the initial stage in which each DS has been successfully written to the tape. In the current state, each DS has only been written to once. As a result, each DS is assigned the same value (WP1). In the lower section of FIG. 1, the WP for overwritten DS#1 through #5 is increased from 1 to 2. The tape drive differentiates an old DS from a new DS in the same overwritten DS# on the tape using the WP value, and reads the new DS.
The complete overwriting of an old DS by a new DS with the same DS# is desirable from the standpoint of data integrity (DI). However, because some errors occur in the write control of a tape drive, both ends of an old DS written to a tape remain. Therefore, when many overwriting operations have been performed, many DS with the same DS# remain on the tape. During sequential reading, the tape drive transfers to the host the DS with the highest WP from among a plurality of DS with the same DS# as the new DS in order to ensure data integrity (DI).
The length of a data set written to a tape medium is approximately 10 cm. When the tape drive write data sets, the interval of sequential data sets has to be less than 4 m. It is because the range to be searched is limited when data sets are read.
The interval between data sets is usually as short as possible. When the interval increases, the recording density in the portion decreases, and the amount of data written to the tape medium decreases. Also, when a certain data set is overwritten (data including a certain data set is updated), the writing begins at the start of the previously written data set with the same DS#. This is to avoid sending to the host a data set containing data prior to the update when the data set is read.
The host can write special data called a file mark (FM) on the tape medium. An FM is the equivalent of a bookmark, and is used as a separator between files. An FM is used for positioning when written data is read.
One FM is written between files and two FM are written at the end of the final file. When using these FM, the host writes two FM when it finishes the writing of files. When the next file is written, the data is usually written so as to overwrite the last FM. The last FM is also overwritten in a WORM cartridge. When data written at the end of data written to a cartridge has a plurality of FM, some of the FM can be deleted.
FIG. 2 is a diagram showing two FM written each time a file is written to tape. In order to realize this function, when a current tape drive writes a plurality of FM to a WORM cartridge, the initial FM and the second and subsequent FM are written to separate data sets. First, File A sent from the host is stored in the buffer memory of the tape drive. When two FM have been written, File A and an FM are stored in DS#N. The data is written to the tape medium with another FM stored in DS#N+1. Next, the drive writes File B and two FM from the host to follow the first FM written after File A. The tape drive writes File B and an FM to DS#N+1. When File A is written, DS#N+1 is overwritten using a WP higher than the WP used for the previously written DS#N+1. Afterwards, an FM is stored in DS#N+2, and DS#N+2 is written after DS#N+1 using the same WP as the last DS#N+1 that was written. Afterwards, File C and so forth are written in the same manner.
International Laid-open Patent Publication No. WO2007/102434 provides a technology for continuing to read data quickly and accurately after a reading error has occurred. This patent literature belongs to the technical field of the present invention in that a tape reading device is connected to a host computer, but it only presents a reading technology.